<?php
# Contains templates for modal windows
# Registered users' modals
if(isset($_REQUEST['theatre']) and $_REQUEST['theatre']=='false' and (isset($_REQUEST['optn']) or isset($optn))) {
	$optn = isset($_REQUEST['optn']) ? $_REQUEST['optn'] : $optn;
	
	# Switch between categories in advanced searches
	switch($optn) {
		# Microorganism
		case "micro":
			$opts = '
				<option value="name" data-guess="micro=guess" selected="selected">Name</option>
				<option value="auth">Author</option>
				<option value="taxon" data-guess="micro=guess&a=taxong&i=0">Taxonomy</option>
				<option value="syno">Synonym</option>
				<option value="comn">Common name</option>
				<option value="host">Host</option>
				<option value="proj" data-guess="proj=guess">Project</option>
				<option value="loc" data-guess="loc=guess">Location</option>
				<option value="id">ID</option>
				<option value="all">All microorganisms</option>
				'.(in_array($_COOKIE['acct']['type'], array('ADMIN','PRIME')) ? '<option value="remove">Removed items</option>' : '').'
			';
			$orders = '
				<option value="name" selected="selected">Name</option>
				<option value="notes">Notes</option>
				<option value="crtby">Author</option>
				<option value="crton">Date of creation</option>
				<option value="id">ID</option>
			';
			$area = 'microorganism';
		break;
		
		# Project
		case "proj":
			$opts = '
				<option value="title" data-guess="proj=guess" selected="selected">Title</option>
				<option value="edtr" data-guess="acct=guess&edtr=1">Author</option>
				<option value="micro" data-guess="micro=guess">Microorganism</option>
				<option value="img" data-guess="img=guess">Image</option>
				<option value="doc" data-guess="doc=guess">Document</option>
				<option value="loc" data-guess="loc=guess">Location</option>
				<option value="id">ID</option>
				'.(in_array($_COOKIE['acct']['type'], array('ADMIN','PRIME')) ? '<option value="remove">Removed items</option>' : '').'
			';
			$orders = '
				<option value="title" selected="selected">Title</option>
				<option value="abstr">Abstract</option>
				<option value="crtby">Author</option>
				<option value="crton">Date of creation</option>
				<option value="id">ID</option>
			';
			$area = 'project';
		break;
		
		# Image
		case "img":
			$opts = '
				<option value="title" data-guess="img=guess" selected="selected">Title</option>
				<option value="proj" data-guess="proj=guess">Project</option>
				<option value="micro" data-guess="micro=guess">Microorganism</option>
				<option value="id">ID</option>
				<option value="all">All images</option>
				'.(in_array($_COOKIE['acct']['type'], array('ADMIN','PRIME')) ? '<option value="remove">Removed items</option>' : '').'
			';
			$orders = '
				<option value="title" selected="selected">Title</option>
				<option value="notes">Notes</option>
				<option value="crtby">Author</option>
				<option value="crton">Date of creation</option>
				<option value="id">ID</option>
			';
			$area = 'image';
		break;
		
		# Document
		case "doc":
			$opts = '
				<option value="title" data-guess="doc=guess" selected="selected">Title</option>
				<option value="proj" data-guess="proj=guess">Project</option>
				<option value="micro" data-guess="micro=guess">Microorganism</option>
				<option value="id">ID</option>
				'.(in_array($_COOKIE['acct']['type'], array('ADMIN','PRIME')) ? '<option value="remove">Removed items</option>' : '').'
			';
			$orders = '
				<option value="title" selected="selected">Title</option>
				<option value="notes">Notes</option>
				<option value="crtby">Author</option>
				<option value="crton">Date of creation</option>
				<option value="id">ID</option>
			';
			$area = 'document';
		break;
		
		# Location
		case "loc":
			$opts = '
				<option value="name" data-guess="loc=guess" selected="selected">Name</option>
				<option value="proj" data-guess="proj=guess">Project</option>
				<option value="micro" data-guess="micro=guess">Microorganism</option>
				<option value="id">ID</option>
				'.(in_array($_COOKIE['acct']['type'], array('ADMIN','PRIME')) ? '<option value="remove">Removed items</option>' : '').'
			';
			$orders = '
				<option value="name" selected="selected">Name</option>
				<option value="notes">Notes</option>
				<option value="crtby">Author</option>
				<option value="crton">Date of creation</option>
				<option value="id">ID</option>
			';
			$area = 'location';
		break;
		
		# Resource
		case "rsrc":
			$opts = '
				<option value="title" data-guess="rsrc=guess" selected="selected">Title</option>
				<option value="micro" data-guess="micro=guess">Microorganism</option>
				<option value="img" data-guess="img=guess">Image</option>
				<option value="doc" data-guess="doc=guess">Document</option>
				<option value="loc" data-guess="loc=guess">Location</option>
				<option value="proj" data-guess="proj=guess">Project</option>
				<option value="id">ID</option>
				'.(in_array($_COOKIE['acct']['type'], array('ADMIN','PRIME')) ? '<option value="remove">Removed items</option>' : '').'
			';
			$orders = '
				<option value="title" selected="selected">Title</option>
				<option value="notes">Notes</option>
				<option value="crtby">Author</option>
				<option value="crton">Date of creation</option>
				<option value="id">ID</option>
			';
			$area = 'resource';
		break;
		
		# Application
		case 'appn':
			$area = 'application';
			$opts = '';
			$orders = '';
		break;
		
		# Account
		case 'acct':
			$area = 'account';
			$opts = '';
			$orders = '';
		break;
	}
	
	# Include create modal
	require_once "create.php"; ?>
	
	<div id="mod-extdsearch" class="modal area <?php echo $optn ?>" data-area="<?php echo $optn ?>">
		<div class="modal-head">
			<b>Extended Search</b>
			<button type="button" class="modal-reject"></button>
		</div>
		<form id="form-extdsearch" method="get" action="main.php">
			<div class="modal-body alright">
				<input name="<?php echo $optn ?>" value="view" class="abled none reqd" type="text"/>
				<label>Keyword/s:</label>
					<input name="q" class="search optl" type="search" autofocus="autofocus" data-guess="<?php echo $optn ?>=guess"/><br/>
					<input name="id" class="abled" type="hidden"/>
				<label>Category:</label>
					<select name="c" class="categ <?php echo $optn ?>"><?php echo $opts ?></select><br/><?php
				if($optn=='micro') { ?><div class="none">
					<label>Taxonomy</label>
					<select name="rnk">
						<option value="0">Kingdom</option>
						<option value="1">Phylum</option>
						<option value="2">Class</option>
						<option value="3">Order</option>
						<option value="4">Family</option>
						<option value="5">Genus</option>
						<option value="6">Species</option>
					</select></div> <?php }
				if($optn=='loc') { ?>
					<label data-tool="{'head':'With 0.5-degree margin'}">Coordinates</label>
						<input name="lat" class="number" type="text" placeholder="Latitude" style="width:142px"/>
						<input name="lng" class="number" type="text" placeholder="Longitude" style="width:142px"/><br/><?php } ?>
				<label>Including:</label>
					<input name="i" type="search" placeholder="Wording or phrase"/><br/>
				<label>Excluding:</label>
					<input name="e" type="search" placeholder="Wording or phrase"/><br/>
				<label>Created by:</label><span>
					<input name="cb" type="search" placeholder="Name of editor" data-guess="acct=guess"/><br/>
					<input name="cbi" type="hidden" class="abled"/></span>
				<label>Created on:</label>
					<input name="co[s]" type="text" placeholder="Start (YYYY-MM-DD)" style="width:142px" class="date" data-tool="{'head':'Start date','x':'l'}"/>
					<input name="co[e]" type="text" placeholder="End (YYYY-MM-DD)" style="width:142px" class="date" data-tool="{'head':'End date','x':'l'}"/><br/>
				<label>Order by:</label>
					<select name="ob" class="abled" style="width:154px"><?php echo $orders ?></select>
					<select name="oa" class="abled" style="width:154px">
						<option value="asc" selected="selected">&#8681; A to Z</option>
						<option value="desc">&#8679; Z to A</option>
					</select>
				<input name="src" class="abled" type="hidden"/>
				<div class="alleft"> <?php
					$ismicro = $optn=='micro';
					$isadmin = in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'));
					
					if($ismicro or $isadmin) { ?>
						<label style="margin-left:35px">Show:</label>
						<?php if($ismicro) { ?>
							<a class="ui ui-button" href="main.php?<?php echo $optn ?>=view&c=all">Everything</a> <?php } ?>
						<?php if($isadmin) { ?>
							<a class="ui ui-button" href="main.php?<?php echo $optn ?>=view&c=remove&q=Removed+items">Removed</a> <?php }
					} ?>
				</div>
			</div>
			<div class="modal-dial">
				<button type="button" class="reset left">Reset</button></span>
				<button type="reset" class="modal-reject">Cancel</button>
				<button type="submit">Search</button>
			</div>
		</form>
	</div>
	
	<div id="modTaxa" class="modal taxb area">
		<div class="modal-head">
			<span>Browse Taxonomy</span>
			<button type="reset" class="modal-reject"></button>
		</div>
		<div class="modal-body">
			<div class="head div-case">
				<form id="search-taxon">
					<select name="rnk" style="width:85px">
						<option value="0">Kingdom</option>
						<option value="1">Phylum</option>
						<option value="2">Class</option>
						<option value="3">Order</option>
						<option value="4">Family</option>
						<option value="5">Genus</option>
						<option value="6">Species</option>
					</select>
					<input name="q" class="search reqd skip" type="search" autofocus="autofocus"
						placeholder="Name of kingdom" data-guess="micro=guess&a=taxong&i=0"/>
					<button type="submit">Search</button>
				</form>
			</div>
			<div class="body div-case"></div>
		</div>
		<div class="modal-dial"></div>
	</div>
	
	<div id="modImg" class="mark modal area lock">
		<div class="modal-head locked">
			<span>
				<button type="submit" class="mark none" style="margin-top:-6px">Mark</button>
				<button type="reset" class="img-home home none" title="Back to original image" style="margin-top:-6px">Home</button>
			</span>
			<button type="reset" class="modal-reject"></button>
		</div>
		<div class="modal-body" style="padding:5px">
			<img src="template/img.jpg" class="full ghost" alt="Staged image" style="border: 1px solid lightgray"/>
			<div class="tiles"></div>
		</div>
	</div>
	
	<div id="modTestImg" class="test modal area lock">
		<div class="modal-head locked">
			<form name="formTestImg" method="post" enctype="multipart/form-data">
				<input name="upload" id="file-test-img" class="upload" type="file" accept="image/jpeg,image/gif"
					data-tool="{'head':'Select an image: <b>.jpg, .jpeg, .gif</b>','x':'l'}" autofocus="autofocus"/>
				<button class="rem-file none cross icon" type="button" title="Remove file"></button>
			</form>
			<button type="reset" class="modal-reject"></button>
		</div>
		<div class="modal-body">
			<img class="full ghost" src="template/img.jpg" alt="Image not available" style="border: 1px solid lightgray"/>
		</div>
	</div>
	
	<div id="modClip" class="clip area" tabindex="0" data-tool="{'head':'<small><b>Info</b></small>',
		'body':'<ul>
			<li>Click on the image to place the clip.</li>
			<li>Resize left or bottom corners.</li>
		</ul>','x':'l','stay':1,'behav':'More','id':'clip-head'}">
		<div class="clip-head" tabindex="0"></div>
		<div class="clip-body mark">
			<form id="form-mark-img">
				<select class="toggle-form" style="width:108px">
					<option value="micro" selected="selected">Microorganism</option>
					<!--<option value="img">Image</option>-->
					<option value="rsrc">Resource</option>
				</select>
				
				<div class="right">
					<div class="none">
						<textarea name="mark[mtitle]" placeholder="Title" title="Title of marked image" rows="1"></textarea>
					</div>
					<a class="peel prev on small right addmore resetoff" data-on="Add title" data-off="Remove title">Add title</a>
				</div>
				
				<div class="clip-opt micro" data-form="mark-micro">
					<input name="mark[val]" type="text" placeholder="Microorganism" data-reqd="1" class="reqd" data-guess="micro=guess" title="Microorganism" autofocus="autofocus"/>
					<input name="mark[id]" type="hidden"/>
				</div>
				
				<div class="clip-opt rsrc none" data-form="mark-rsrc">
					<input name="mark[title]" type="text" placeholder="Resource title" data-reqd="1" title="Resource title" autofocus="autofocus"/><br/>
					<input name="mark[link]" type="url" placeholder="Link (optional)" title="Link"/>
					<textarea name="mark[notes]" placeholder="Notes" rows="5" data-reqd="1" title="Notes"></textarea>
					<input name="mark[ref]" type="url" placeholder="Reference (optional)" title="Reference"/>
				</div>
				
				<span class="small none">
					<select name="categ" class="abled small dim" style="width:80px" data-tool="{'head':'Category'}">
						<option value="ADV">Advanced</option>
						<option value="BSC" selected="selected">Basic</option>
					</select>
					
					<select name="visib" class="abled small dim" style="width:80px" data-tool="{'head':'Visibility'}">
						<option value="PRV">Private</option>
						<option value="PUB" selected="selected">Public</option>
					</select> &nbsp;&nbsp;
				</span>
				<a class="peel prev on small vanish" title="Category and visibility">Settings</a>
				
				<div class="div-mind">
					<input type="hidden" name="id"/>
					<input type="text" name="coords[]"/>
					<input type="text" name="coords[]"/>
					<input type="text" name="size[]"/>
					<input type="text" name="size[]"/>
					<input type="text" name="path"/>
					<input type="text" name="height"/>
				</div>
				
				<div class="clip-dial alright">
					<button type="button" class="clear">Clear</button>
					<button type="button" class="bubble-reject">Close</button>
					<button type="submit">Mark</button>
				</div>
			</form>
		</div>
	</div>
	
	<div id="modMark" class="mark modal bubble area">
		<div class="bubble-wrap">
			<div class="modal-head">
				<span>
					<select class="toggle-thumb-opt">
						<option value="home">Image details</option>
						<option value="micro">Microorganisms</option>
						<option value="img">Images</option>
						<option value="rsrc">Resources</option>
					</select>
				</span>
				
				<button type="button" class="bubble-reject cancel right"></button>
			</div>
			
			<div class="body">
				<div class="head-home"></div>
				<div class="head-micro none"></div>
				<div class="head-img none"></div>
				<div class="head-rsrc none"></div>
			</div>
			
			<div class="foot">
				<div class="hand details alright">
					<span class="permalink left"></span>
					<span>
						<button type="button" class="handle" data-area="micro">Microorganisms</button>
						<button type="button" class="handle" data-area="img">Images</button>
						<button type="button" class="handle" data-area="rsrc">Resources</button>
					</span>
				</div>
				
				<div class="hand micro alright none">
					<div class="permalink left"></div>
					<button type="button" class="home handle none" data-area="home"></button>
					<form class="mark-add clip micro none" data-form="mark-micro">
						<input name="mark[val]" type="text" placeholder="Microorganism" class="reqd" data-guess="micro=guess" autofocus="autofocus"/><br/>
						<input name="mark[id]" type="hidden"/>
						
						<div class="div-mind">
							<input type="text" name="id"/>
							<input type="text" name="coords[]"/>
							<input type="text" name="coords[]"/>
							<input type="text" name="size[]"/>
							<input type="text" name="size[]"/>
						</div>
						
						<span class="notif small"></span>
						<button type="submit">Submit</button>
					</form>
					<button type="button" class="add-handle peel on prev cancel" title="Microorganism" data-on="Tag" data-off="Cancel" data-area="head-micro">Tag</button>
				</div>
				
				<div class="hand img alright none">
					<div class="permalink left"></div>
					<button type="button" class="home handle none" data-area="home"></button>
					<form class="mark-add clip img none" data-form="mark-img">
						<input name="mark[val]" type="text" placeholder="Image title" class="reqd" data-guess="img=guess" autofocus="autofocus"/><br/>
						<input name="mark[id]" type="hidden"/>
						
						<div class="div-mind">
							<input type="text" name="id"/>
							<input type="text" name="coords[]"/>
							<input type="text" name="coords[]"/>
							<input type="text" name="size[]"/>
							<input type="text" name="size[]"/>
						</div>
						
						<span class="notif small"></span>
						<button type="submit">Submit</button>
					</form>
					<button type="button" class="add-handle peel on prev cancel" title="Image" data-on="Mark" data-off="Cancel" data-area="head-img">Mark</button>
				</div>
				
				<div class="hand rsrc none alright">
					<span class="permalink left"></span>
					<button type="button" class="home handle none" data-area="home"></button>
					<form class="mark-add clip rsrc none" data-form="mark-rsrc">
						<input name="mark[title]" type="text" placeholder="Title" class="reqd" autofocus="autofocus"/><br/>
						<input name="mark[link][]" type="text" placeholder="Link"/><br/>
						<textarea name="mark[notes]" placeholder="Notes" class="reqd" rows="5"></textarea><br/>
						<span class="addmore peel on next vanish left"><a title="Add reference details">Reference</a></span>
						<span class="none">
							<input name="mark[ref]" type="text" placeholder="Reference"/>
						</span>
						<input name="mark[id]" type="hidden"/>
						
						<div class="div-mind">
							<input type="text" name="id"/>
							<input type="text" name="coords[]"/>
							<input type="text" name="coords[]"/>
							<input type="text" name="size[]"/>
							<input type="text" name="size[]"/>
						</div>
						
						<span class="notif small"></span>
						<button type="submit">Submit</button>
					</form>
					<button type="button" class="add-handle peel on prev cancel" title="Thought, link, or external source" data-on="Share" data-off="Cancel" data-area="head-rsrc"><span>Share</span></button>
				</div>
			</div>
		</div>
	</div>
	
	<div id="modDoc" class="modal doc area lock">
		<div class="modal-head locked">
			<div class="title escape" style="width:800px"></div>
			<button type="button" class="modal-reject"></button>
		</div>
		<div class="modal-body" style="padding:5px">
			<div class="cover"></div>
			<embed class="doc" type="application/pdf">
		</div>
	</div>
	
	<div id="modMap" class="modal area map loc lock">
		<div class="modal-head locked">
			<span>
				<input class="loc gmap" type="search" autofocus="autofocus" placeholder="Search location"
					data-guess="loc=guess" data-tool="{'head':'Search a place','x':'l'}"/> &nbsp;
				<span class="map help"></span>
			</span>
			<button type="button" class="modal-reject"></button>
		</div>
		<div class="modal-body">
			<div class="world"><label>Google Maps is not available</label></div>
		</div>
	</div>
	
	<div id="modShare" class="share modal area">
		<form class="share rsrc" action="process.php?rsrc=share" method="post" enctype="multipart/form-data">
			<div class="modal-head"><b>Share resource</b> <button type="button" class="modal-reject"></button></div>
			
			<div class="modal-body">
				<div class="div-peel"><b>Title</b></div>
				<div class="div-case">
					<input name="title" type="text" class="reqd" autofocus="autofocus"/>
				</div>
				
				<div class="div-peel"><b>Notes</b></div>
				<div class="div-case">
					<textarea name="notes" class="reqd" rows="5"></textarea><br/>
				</div>
				
				<div class="div-peel"><b>Links</b></div>
				<div class="div-case">
					<div class="default">
						<input name="link[]" type="text" class="link" value="http://"/>
						<button class="append icon" type="button"></button>
					</div>
					<div class="links"></div>
				</div>
				
				<div class="div-peel"><b>Files</b></div>
				<div class="div-case">
					<input name="file[]" type="file" multiple="multiple" accept="image/jpeg,image/gif,application/pdf"/>
				</div>
				
				<div class="div-peel peel on next"><b>Settings</b><span class="setting help"></span></div>
				<div class="div-case none">
					Category: <select name="categ" class="safe abled">
						<option value="ADV">Advanced</option>
						<option value="BSC">Basic</option></select> &nbsp; &nbsp; &nbsp;
					
					Visibility: <select name="visib" class="safe abled">
						<option value="PRV">Private</option>
						<option value="PUB">Public</option></select> <br/>
					
					<label class="coed">Coeditors:</label>
					<div class="none">
						<div class="default">
							<input name="coed[val][]" type="text" class="coed" placeholder="Account name or Email" data-guess="acct=guess"/>
							<button class="append icon" type="button" data-area="coed" data-id="0" data-area="acct" data-id="0"></button>
							<input type="hidden" name="coed[id][]" class="abled"/><br/>
						</div>
						<div class="coeds"></div>
					</div>
					<button type="button" class="addmore peel on prev" data-on="Add" data-off="Cancel">Add</button>
				</div>
				
				<div class="div-mind">
					<input name="id" type="hidden" class="abled"/>
					<input name="area" type="hidden" class="abled"/>
				</div>
			</div>
			
			<div class="modal-dial">
				<span class="left"><button type="button" class="clear">Clear</button></span>
				
				<span>
					<button type="reset" class="modal-reject">Cancel</button>
					<button type="submit">Share</button>
				</span>
			</div>
		</form>
	</div>
	
	<div id="modOpen" class="modal area lock">
		<div class="modal-head"></div>
		<div class="modal-body"></div>
		<div class="modal-dial"></div>
	</div>
	
	<div id="modEdtr" class="modal area acct">
		<form action="process.php?edtr=edit" method="post" enctype="multipart/form-data">
			<div class="modal-head">
				<span class="title">Edit</span>
				<button type="button" class="modal-reject"></button>
			</div>
			<div class="modal-body alright">
				<label>Last name:</label> <input name="lname" type="text"/><br/>
				<label>First name:</label> <input name="fname" type="text"/><br/>
				<label>Middle name:</label> <input name="mname" type="text"/><hr class="bold"/>
				<label>Email:</label> <input name="email" type="email"/><br/>
				<label>Type:</label>
				<span style="padding-right:173px">
					<input name="auth" type="checkbox"/> <label>Author</label> &nbsp;
					<input name="edtr" type="checkbox"/> <label>Editor</label>
				</span>
				<!--<label>Photo:</label> <input name="photo" type="file" accept="image/jpeg,image/gif" title="Choose a profile photo"/>-->
				
				<div class="div-mind">
					<input name="id" type="hidden" class="abled"/>
				</div>
			</div>
			<div class="modal-dial">
				<button type="reset" class="modal-reject">Cancel</button>
				<button type="submit">Submit</button>
			</div>
		</form>
	</div>
	
	<div id="modEmpty" class="notif modal area lock empty">
		<div class="modal-head"><b>Sorry&#8230;</b></div>
		<div class="modal-body medium alcenter">No <?php echo $area ?>s are available.</div>
		<div class="modal-dial alcenter">
			<a href="main.php?micro=view" class="ui ui-button">Home</a>
		</div>
	</div>
	
	<div id="modDetails" class="modal area" style="min-width:400px">
		<div class="modal-head">
			<span>Details</span>
			<button type="button" class="modal-reject"></button>
		</div>
		<div class="modal-body"></div>
		<div class="modal-dial">
			<button type="submit" class="modal-reject">Okay</button>
		</div>
	</div>
	
	<div id="modSearchFail" class="notif modal area lock">
		<div class="modal-head"><b>Sorry&#8230;</b></div>
		<div class="modal-body medium alcenter"><? 
			echo empty($_REQUEST['t']) ? "Items not found."
				: "<b>".htmlspecialchars(urldecode($_REQUEST['t']))."</b> not found." ?>
		</div>
		<div class="modal-dial alcenter">
			<button type="submit" class="modal-accept">Okay</button>
		</div>
	</div>
	
	<div id="modGetFail" class="notif modal area lock">
		<div class="modal-head"><b>Sorry&#8230;</b></div>
		<div class="modal-body medium alcenter">
			Failed to download <b><?php echo isset($_REQUEST['id']) ? $_REQUEST['id'] : 'item' ?></b>.<br/>
			Permission is required to download the item.
		</div>
		<div class="modal-dial alcenter">
			<button type="submit" class="modal-accept">Okay</button>
		</div>
	</div>
	
	<div id="modError" class="notif modal area lock">
		<div class="modal-head"><b>Sorry&#8230;</b></div>
		<div class="modal-body medium alcenter">An unexpected error occurred. Please try again later.</div>
		<div class="modal-dial alcenter">
			<button type="submit" class="modal-accept">Okay</button>
		</div>
	</div> <?php
}
# Guest modals
else { ?>
	<div id="mod-signup" class="modal area">
		<div class="modal-head"><b>Sign up</b> <button type="button" class="modal-reject"></button></div>
		<form id="form-signup" method="post" action="sign.php?up">
			<div class="modal-body alright">
				<label>Email:</label> <input name="email" type="email" class="reqd" autofocus="autofocus"/><br/>
				<label>Password:</label> <input name="pword" type="password" class="reqd tipped"/><br/>
				<label>Repeat password:</label> <input name="pwordRep" type="password" class="reqd"/><br/>
				<label>Last name:</label> <input name="lname" type="text" class="reqd"/><br/>
				<label>First name:</label> <input name="fname" type="text" class="reqd"/><br/>
				<label>Middle name:</label> <input name="mname" type="text" class="reqd"/><br/>
				<label>Address:</label> <input name="addrs" type="text" class="reqd"/>
			</div>
			<div class="modal-dial">
				<div class="left">I agree to the <a>terms of service</a>.</div>
				<button type="reset" class="modal-reject">Cancel</button>
				<button type="submit">Sign up</button>
			</div>
		</form>
	</div>
	
	<div id="modMark" class="theatre mark modal bubble area">
		<div class="bubble-wrap">
			<div class="modal-head">
				<span>
					<select class="toggle-thumb-opt">
						<option value="home">Image details</option>
						<option value="micro">Microorganisms</option>
						<option value="img">Images</option>
					</select>
				</span>
				<button type="button" class="bubble-reject cancel right"></button>
			</div>
			
			<div class="body">
				<div class="head-home"></div>
				<div class="head-micro"></div>
				<div class="head-img"></div>
			</div>
		</div>
	</div>
	
	<div id="modStop" class="notif warn modal area lock">
		<form class="form-signin" method="post" action="sign.php?in">
			<div class="modal-head"><b>Restricted</b> <button type="button" class="modal-reject"></button></div>
			<div class="modal-body">
				<label>Please sign in to access content.</label>
				<div class="alright">
					<input name="emailIn" type="email" placeholder="Email" class="reqd"/><br/>
					<input name="pwordIn" type="password" placeholder="Password" class="reqd tipped"/>
				</div>
			</div>
			<div class="modal-dial">
				<div class="left">Not registered? <a data-modal="#mod-signup">Sign up</a>.</div>
				<button type="submit">Sign in</button>
			</div>
		</form>
	</div>
	
	<div id="modSignin" class="notif warn modal area lock">
		<form class="form-signin" method="post" action="sign.php?in">
			<div class="modal-head"><b>Error</b> <button type="button" class="modal-reject"></button></div>
			<div class="modal-body alright">
				Wrong email and/or password. Try again.<hr class="hide"/>
				<input name="emailIn" type="email" placeholder="Email" class="reqd" autofocus="autofocus" data-tool="{'head':'<b>Email</b>'}"/><br/>
				<input name="pwordIn" type="password" placeholder="Password" class="reqd tipped"/>
			</div>
			<div class="modal-dial">
				<!--<div class="left"><a class="forgot">Forgot details?</a></div>-->
				<button type="button" class="modal-reject">Cancel</button>
				<button type="submit">Sign in</button>
			</div>
		</form>
	</div> <?php
} ?>

<div id="modNotif" class="modal notif area">
	<div class="modal-head"></div>
	<div class="modal-body"></div>
	<div class="modal-dial"></div>
</div>

<div id="tips">
	<div id="tip" class="tip area">
		<div class="tipHair"></div>
		<div class="tipHead"></div>
		<div class="tipBody"></div>
		<div class="tipFoot"></div>
	</div>
</div>

<div id="loading"><span id="load">Loading&#8230;</span></div>

<div id="guess" class="guesses">
	<div class="guess-head"></div>
	<div class="guess-body"></div>
</div>